﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/UserMaster.master"
    Inherits="System.Web.Mvc.ViewPage<List<Eacademy.Domain.Models.MessageViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    View Message
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <%=ViewData["subject"]%></h2>
    <table class="message-container">
        <%
            foreach (MessageViewModel message in Model)
            {
        %>
        <tr>
            <td class="img-col">
                <img src="/content/images/default_avatar.jpg" width="50" height="50" />
            </td>
            <td>
                <span class="from-msg">
                    <%=message.NameOfSender %></span> <span class="date-msg">
                        <%=message.DateSent.ToShortDateString() %></span> <span class="body-msg">
                            <%=message.Message %></span>
            </td>
        </tr>
        <%
            }
        %>
    </table>
    <table class="reply-container">
        <% using (Html.BeginForm("Reply", "Messages", FormMethod.Post, new { autocomplete = "off" }))
           {%>
        <tr>
            <td>
                <span class="reply-msg">Reply:</span>
                <textarea name="message" cols="70" rows="5"></textarea>
            </td>
            <td class="send-msg">
                <input type="hidden" name="conversationid" value="<%=ViewData["cid"] %>" />
                <input type="submit" class="button-style" value="send" />
            </td>
        </tr>
        <%
            }
        %>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
